package com.bbh.plugin.single.privilege.demo.filter;

import org.apache.shiro.subject.Subject;
import org.springframework.boot.config.shiro.base.entity.Principal;
import org.springframework.boot.config.shiro.base.service.ShiroService;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

/**
 * Created by TANYI on 2017/4/1.
 */
//@Service
public class ShiroServiceImpl implements ShiroService {
    @Override
    public void preLogin(Principal principal) {
        principal.setAttribute1("abcdefghigklmnopqrstuvwxyz");
        principal.setMasterId("123456");
    }

    @Override
    public void successLogin(Subject subject, ServletRequest servletRequest, ServletResponse servletResponse) {
      subject.getSession().setAttribute("id","123456789");
    }
}
